Optimal. Leaf size=191 \[ -\frac {8 (A+4 i B) c^5 x}{a^3}-\frac {8 (i A-4 B) c^5 \log (\cos (e+f x))}{a^3 f}+\frac {16 (A+i B) c^5}{3 a^3 f (i-\tan (e+f x))^3}+\frac {8 (2 i A-3 B) c^5}{a^3 f (i-\tan (e+f x))^2}-\frac {8 (3 A+7 i B) c^5}{a^3 f (i-\tan (e+f x))}+\frac {(A+8 i B) c^5 \tan (e+f x)}{a^3 f}+\frac {B c^5 \tan ^2(e+f x)}{2 a^3 f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.16, antiderivative size = 191, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.049, Rules used = {3669, 78}
\begin {gather*} \frac {c^5 (A+8 i B) \tan (e+f x)}{a^3 f}-\frac {8 c^5 (3 A+7 i B)}{a^3 f (-\tan (e+f x)+i)}+\frac {8 c^5 (-3 B+2 i A)}{a^3 f (-\tan (e+f x)+i)^2}+\frac {16 c^5 (A+i B)}{3 a^3 f (-\tan (e+f x)+i)^3}-\frac {8 c^5 (-4 B+i A) \log (\cos (e+f x))}{a^3 f}-\frac {8 c^5 x (A+4 i B)}{a^3}+\frac {B c^5 \tan ^2(e+f x)}{2 a^3 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 78
Rule 3669
Rubi steps
\begin {align*} \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^5}{(a+i a \tan (e+f x))^3} \, dx &=\frac {(a c) \text {Subst}\left (\int \frac {(A+B x) (c-i c x)^4}{(a+i a x)^4} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(a c) \text {Subst}\left (\int \left (\frac {(A+8 i B) c^4}{a^4}+\frac {B c^4 x}{a^4}+\frac {16 (A+i B) c^4}{a^4 (-i+x)^4}+\frac {16 (-2 i A+3 B) c^4}{a^4 (-i+x)^3}-\frac {8 (3 A+7 i B) c^4}{a^4 (-i+x)^2}+\frac {8 i (A+4 i B) c^4}{a^4 (-i+x)}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac {8 (A+4 i B) c^5 x}{a^3}-\frac {8 (i A-4 B) c^5 \log (\cos (e+f x))}{a^3 f}+\frac {16 (A+i B) c^5}{3 a^3 f (i-\tan (e+f x))^3}+\frac {8 (2 i A-3 B) c^5}{a^3 f (i-\tan (e+f x))^2}-\frac {8 (3 A+7 i B) c^5}{a^3 f (i-\tan (e+f x))}+\frac {(A+8 i B) c^5 \tan (e+f x)}{a^3 f}+\frac {B c^5 \tan ^2(e+f x)}{2 a^3 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 5.63, size = 347, normalized size = 1.82 \begin {gather*} \frac {c^5 \sec ^2(e+f x) (\cos (f x)+i \sin (f x))^3 \left (12 (-i A+2 B) \cos (4 f x) (\cos (e)-i \sin (e))+36 i (A+3 i B) \cos (2 f x) (\cos (e)+i \sin (e))+48 (-i A+4 B) \log (\cos (e+f x)) \left (\cos \left (\frac {3 e}{2}\right )+i \sin \left (\frac {3 e}{2}\right )\right )^2-48 (A+4 i B) f x (\cos (3 e)+i \sin (3 e))+3 B \sec ^2(e+f x) (\cos (3 e)+i \sin (3 e))+4 (A+i B) \cos (6 f x) (i \cos (3 e)+\sin (3 e))+6 (A+8 i B) \sec (e) \sec (e+f x) (\cos (3 e)+i \sin (3 e)) \sin (f x)+36 (A+3 i B) (\cos (e)+i \sin (e)) \sin (2 f x)-12 (A+2 i B) (\cos (e)-i \sin (e)) \sin (4 f x)+4 (A+i B) (\cos (3 e)-i \sin (3 e)) \sin (6 f x)\right ) (A+B \tan (e+f x))}{6 f (A \cos (e+f x)+B \sin (e+f x)) (a+i a \tan (e+f x))^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.35, size = 123, normalized size = 0.64
method | result | size |
derivativedivides | \(\frac {c^{5} \left (A \tan \left (f x +e \right )+8 i B \tan \left (f x +e \right )+\frac {B \left (\tan ^{2}\left (f x +e \right )\right )}{2}-\frac {16 i B +16 A}{3 \left (-i+\tan \left (f x +e \right )\right )^{3}}+\left (8 i A -32 B \right ) \ln \left (-i+\tan \left (f x +e \right )\right )-\frac {-56 i B -24 A}{-i+\tan \left (f x +e \right )}-\frac {-32 i A +48 B}{2 \left (-i+\tan \left (f x +e \right )\right )^{2}}\right )}{f \,a^{3}}\) | \(123\) |
default | \(\frac {c^{5} \left (A \tan \left (f x +e \right )+8 i B \tan \left (f x +e \right )+\frac {B \left (\tan ^{2}\left (f x +e \right )\right )}{2}-\frac {16 i B +16 A}{3 \left (-i+\tan \left (f x +e \right )\right )^{3}}+\left (8 i A -32 B \right ) \ln \left (-i+\tan \left (f x +e \right )\right )-\frac {-56 i B -24 A}{-i+\tan \left (f x +e \right )}-\frac {-32 i A +48 B}{2 \left (-i+\tan \left (f x +e \right )\right )^{2}}\right )}{f \,a^{3}}\) | \(123\) |
risch | \(-\frac {18 c^{5} {\mathrm e}^{-2 i \left (f x +e \right )} B}{a^{3} f}+\frac {6 i c^{5} {\mathrm e}^{-2 i \left (f x +e \right )} A}{a^{3} f}+\frac {4 c^{5} {\mathrm e}^{-4 i \left (f x +e \right )} B}{a^{3} f}-\frac {2 i c^{5} {\mathrm e}^{-4 i \left (f x +e \right )} A}{a^{3} f}-\frac {2 c^{5} {\mathrm e}^{-6 i \left (f x +e \right )} B}{3 a^{3} f}+\frac {2 i c^{5} {\mathrm e}^{-6 i \left (f x +e \right )} A}{3 a^{3} f}-\frac {64 i c^{5} B x}{a^{3}}-\frac {16 c^{5} A x}{a^{3}}-\frac {64 i c^{5} B e}{f \,a^{3}}-\frac {16 c^{5} A e}{f \,a^{3}}-\frac {2 c^{5} \left (-i A \,{\mathrm e}^{2 i \left (f x +e \right )}+7 B \,{\mathrm e}^{2 i \left (f x +e \right )}-i A +8 B \right )}{f \,a^{3} \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{2}}+\frac {32 c^{5} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) B}{f \,a^{3}}-\frac {8 i c^{5} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) A}{f \,a^{3}}\) | \(285\) |
norman | \(\frac {\frac {\left (8 i c^{5} B +A \,c^{5}\right ) \left (\tan ^{7}\left (f x +e \right )\right )}{a f}+\frac {\left (32 i c^{5} B +9 A \,c^{5}\right ) \tan \left (f x +e \right )}{a f}+\frac {\left (80 i c^{5} B +27 A \,c^{5}\right ) \left (\tan ^{5}\left (f x +e \right )\right )}{a f}-\frac {8 \left (4 i c^{5} B +A \,c^{5}\right ) x}{a}-\frac {-80 i c^{5} A +233 B \,c^{5}}{6 a f}-\frac {24 \left (4 i c^{5} B +A \,c^{5}\right ) x \left (\tan ^{2}\left (f x +e \right )\right )}{a}-\frac {24 \left (4 i c^{5} B +A \,c^{5}\right ) x \left (\tan ^{4}\left (f x +e \right )\right )}{a}-\frac {8 \left (4 i c^{5} B +A \,c^{5}\right ) x \left (\tan ^{6}\left (f x +e \right )\right )}{a}+\frac {\left (248 i c^{5} B +41 A \,c^{5}\right ) \left (\tan ^{3}\left (f x +e \right )\right )}{3 a f}-\frac {\left (-32 i c^{5} A +100 B \,c^{5}\right ) \left (\tan ^{2}\left (f x +e \right )\right )}{a f}-\frac {\left (-40 i c^{5} A +83 B \,c^{5}\right ) \left (\tan ^{4}\left (f x +e \right )\right )}{a f}+\frac {B \,c^{5} \left (\tan ^{8}\left (f x +e \right )\right )}{2 a f}}{a^{2} \left (1+\tan ^{2}\left (f x +e \right )\right )^{3}}-\frac {4 \left (-i c^{5} A +4 B \,c^{5}\right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{a^{3} f}\) | \(368\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.30, size = 279, normalized size = 1.46 \begin {gather*} -\frac {2 \, {\left (24 \, {\left (A + 4 i \, B\right )} c^{5} f x e^{\left (10 i \, f x + 10 i \, e\right )} + 4 \, {\left (-i \, A + 4 \, B\right )} c^{5} e^{\left (4 i \, f x + 4 i \, e\right )} + {\left (i \, A - 4 \, B\right )} c^{5} e^{\left (2 i \, f x + 2 i \, e\right )} + {\left (-i \, A + B\right )} c^{5} + 12 \, {\left (4 \, {\left (A + 4 i \, B\right )} c^{5} f x + {\left (-i \, A + 4 \, B\right )} c^{5}\right )} e^{\left (8 i \, f x + 8 i \, e\right )} + 6 \, {\left (4 \, {\left (A + 4 i \, B\right )} c^{5} f x + 3 \, {\left (-i \, A + 4 \, B\right )} c^{5}\right )} e^{\left (6 i \, f x + 6 i \, e\right )} + 12 \, {\left ({\left (i \, A - 4 \, B\right )} c^{5} e^{\left (10 i \, f x + 10 i \, e\right )} + 2 \, {\left (i \, A - 4 \, B\right )} c^{5} e^{\left (8 i \, f x + 8 i \, e\right )} + {\left (i \, A - 4 \, B\right )} c^{5} e^{\left (6 i \, f x + 6 i \, e\right )}\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )\right )}}{3 \, {\left (a^{3} f e^{\left (10 i \, f x + 10 i \, e\right )} + 2 \, a^{3} f e^{\left (8 i \, f x + 8 i \, e\right )} + a^{3} f e^{\left (6 i \, f x + 6 i \, e\right )}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.94, size = 473, normalized size = 2.48 \begin {gather*} \frac {2 i A c^{5} - 16 B c^{5} + \left (2 i A c^{5} e^{2 i e} - 14 B c^{5} e^{2 i e}\right ) e^{2 i f x}}{a^{3} f e^{4 i e} e^{4 i f x} + 2 a^{3} f e^{2 i e} e^{2 i f x} + a^{3} f} + \begin {cases} \frac {\left (\left (2 i A a^{6} c^{5} f^{2} e^{6 i e} - 2 B a^{6} c^{5} f^{2} e^{6 i e}\right ) e^{- 6 i f x} + \left (- 6 i A a^{6} c^{5} f^{2} e^{8 i e} + 12 B a^{6} c^{5} f^{2} e^{8 i e}\right ) e^{- 4 i f x} + \left (18 i A a^{6} c^{5} f^{2} e^{10 i e} - 54 B a^{6} c^{5} f^{2} e^{10 i e}\right ) e^{- 2 i f x}\right ) e^{- 12 i e}}{3 a^{9} f^{3}} & \text {for}\: a^{9} f^{3} e^{12 i e} \neq 0 \\x \left (- \frac {- 16 A c^{5} - 64 i B c^{5}}{a^{3}} + \frac {\left (- 16 A c^{5} e^{6 i e} + 12 A c^{5} e^{4 i e} - 8 A c^{5} e^{2 i e} + 4 A c^{5} - 64 i B c^{5} e^{6 i e} + 36 i B c^{5} e^{4 i e} - 16 i B c^{5} e^{2 i e} + 4 i B c^{5}\right ) e^{- 6 i e}}{a^{3}}\right ) & \text {otherwise} \end {cases} - \frac {8 i c^{5} \left (A + 4 i B\right ) \log {\left (e^{2 i f x} + e^{- 2 i e} \right )}}{a^{3} f} + \frac {x \left (- 16 A c^{5} - 64 i B c^{5}\right )}{a^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 516 vs. \(2 (169) = 338\).
time = 1.30, size = 516, normalized size = 2.70 \begin {gather*} \frac {2 \, {\left (\frac {60 \, {\left (-i \, A c^{5} + 4 \, B c^{5}\right )} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1\right )}{a^{3}} - \frac {120 \, {\left (-i \, A c^{5} + 4 \, B c^{5}\right )} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - i\right )}{a^{3}} - \frac {60 \, {\left (i \, A c^{5} - 4 \, B c^{5}\right )} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1\right )}{a^{3}} + \frac {15 \, {\left (6 i \, A c^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} - 24 \, B c^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} - A c^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 8 i \, B c^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 12 i \, A c^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 49 \, B c^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + A c^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 8 i \, B c^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 6 i \, A c^{5} - 24 \, B c^{5}\right )}}{{\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 1\right )}^{2} a^{3}} - \frac {2 \, {\left (147 i \, A c^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{6} - 588 \, B c^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{6} + 942 \, A c^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} + 3708 i \, B c^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} - 2445 i \, A c^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} + 9660 \, B c^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} - 3460 \, A c^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 13240 i \, B c^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 2445 i \, A c^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 9660 \, B c^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 942 \, A c^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 3708 i \, B c^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 147 i \, A c^{5} + 588 \, B c^{5}\right )}}{a^{3} {\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - i\right )}^{6}}\right )}}{15 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 8.98, size = 233, normalized size = 1.22 \begin {gather*} \frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )-\mathrm {i}\right )\,\left (-\frac {32\,B\,c^5}{a^3}+\frac {A\,c^5\,8{}\mathrm {i}}{a^3}\right )}{f}+\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (\frac {c^5\,\left (A+B\,4{}\mathrm {i}\right )}{a^3}+\frac {B\,c^5\,4{}\mathrm {i}}{a^3}\right )}{f}+\frac {\frac {5\,\left (-32\,B\,c^5+A\,c^5\,8{}\mathrm {i}\right )}{3\,a^3}+\mathrm {tan}\left (e+f\,x\right )\,\left (\frac {\left (-32\,B\,c^5+A\,c^5\,8{}\mathrm {i}\right )\,4{}\mathrm {i}}{a^3}+\frac {B\,c^5\,40{}\mathrm {i}}{a^3}\right )-{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (\frac {3\,\left (-32\,B\,c^5+A\,c^5\,8{}\mathrm {i}\right )}{a^3}+\frac {40\,B\,c^5}{a^3}\right )+\frac {16\,B\,c^5}{a^3}}{f\,\left (-{\mathrm {tan}\left (e+f\,x\right )}^3\,1{}\mathrm {i}-3\,{\mathrm {tan}\left (e+f\,x\right )}^2+\mathrm {tan}\left (e+f\,x\right )\,3{}\mathrm {i}+1\right )}+\frac {B\,c^5\,{\mathrm {tan}\left (e+f\,x\right )}^2}{2\,a^3\,f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________